<extend name="Base/common"/>
<!--<script type="text/javascript" src="/SG_Shopwechat/Public/Home/js/iscroll.js"></script>-->
<block name="TITLE"><title>采购申请</title></block>
<block name="body" >
    <header data-am-widget="header" class="am-header am-header-default am-header-fixed">
        <div class="am-header-left am-header-nav">
            <a href="{:U('Purchase/index')}" class="">
                <i class="am-header-icon am-icon-home" style="font-size: 40px;"></i>
            </a>
        </div>
        <h1 class="am-header-title">
            <a href="#title-link" class="">
                &nbsp;{$title}
            </a>
        </h1>
    </header>
    <body>
    <div class="">
    </div>
    <empty name="list">

        <else/>
        <table class="am-table " style="font-size: 15px;">
            <tr>
                <th>批次</th>
                <td>{$list.batch}</td>
                <th>创建时间</th>
                <td>{$list.createdAt|time_format}</td>
            </tr>
            <tr>
                <th>创建人</th>
                <td>{$list.user}</td>
                <th>说明</th>
                <td>{$list.mark}</td>
            </tr>
        </table>
    </empty>
    <empty name="_goods">
        暂时没有商品
        <else/>
        <table  class="am-table am-table-striped" style="width:100%;font-size: 15px;">
            <thead style="">
                <tr>
                    <th></th>
                    <th>商品名</th>
                    <th>斤</th>
                    <th>头</th>
                    <th>往期价</th>
                    <th class="">操作</th>
                </tr>
            </thead>
            <volist name="_goods" id="pro">
                <tr>
                    <td>
                        <a href="{:U('prodelete')}&id={$pro.id}&proName={$pro.proName}&batch={$list.batch}" class="am-icon am-icon-trash am-text-danger"></a>
                    </td>
                    <if condition="$pro['reportcount'] gt 0">
                        <td>
                            <a href="{:U('proreport')}&pid={$pro.pid}&batch={$pro.batch}" >{$pro.proName}<span class="am-icon am-icon-reply"></span></a>
                        </td>
                        <else/>
                        <td>{$pro.proName}</td>
                    </if>
                    <td>{$pro.jin}</td>
                    <td>{$pro.head}</td>
                    <td>{$pro.oldPrice}</td>
                    <td class="am-text-left">
                        <a href="{:U('editpro')}&id={$pro.id}&proName={$pro.proName}&batch={$list.batch}" class="am-btn am-radius am-btn-warning am-btn-sm">改</a>
                        <if condition="$pro['status'] eq 1">
                            <a href="{:U('profinish')}&batch={$pro.batch}&pid={$pro.pid}" class="am-btn am-radius am-btn-danger am-btn-sm">直购</a>
                        </if>
                        <if condition="$pro['status'] eq 2">
                            <a  class="am-btn am-radius am-btn-primary">已经采购</a>
                        </if>
                    </td>
                </tr>
            </volist>
        </table>
    </empty>
    <section class="am-panel am-panel-primary  am-radius"  style="display: block;width: 80%;">
        <header class="am-panel-hd">
            <h3 class="am-panel-title">操作</h3>
        </header>
        <div class="am-panel-bd">
            <if condition="$list['status'] eq 1">
                <a href="{:U('sendlist')}&batch={$list['batch']}" class="am-btn am-radius am-btn-sm am-btn-warning">寻求报价</a>
            </if>
            <a href="{:U('newlist')}" class="am-btn am-radius am-btn-danger am-btn-sm confirm">新建预购单</a>
        </div>
    </section>
    </body>
</block>
<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type="text/javascript">
        $('.confirm').click(function(){
            if(confirm("请确认操作")){
            }else{
                return false;
            }
        })
    </script>
</block>
